clear
set mem 500m
use "Marginal.Effects.FULL.ZIOPCDGP.dta", clear

generate RMSE_mean_OP=(OP_RMSE_X1_Y0+OP_RMSE_X2_Y0+OP_RMSE_X1_Y1+OP_RMSE_X2_Y1+OP_RMSE_X1_Y2+OP_RMSE_X2_Y2)/6
generate RMSE_sd_OP=RMSE_mean_OP


generate RMSE_mean_ZIOP=(ZIOP_RMSE_X1_Y0+ZIOP_RMSE_X2_Y0+ZIOP_RMSE_X1_Y1+ZIOP_RMSE_X2_Y1+ZIOP_RMSE_X1_Y2+ZIOP_RMSE_X2_Y2)/6
generate RMSE_sd_ZIOP=RMSE_mean_ZIOP


generate RMSE_mean_ZIOPC=(ZIOPC_RMSE_X1_Y0+ZIOPC_RMSE_X2_Y0+ZIOPC_RMSE_X1_Y1+ZIOPC_RMSE_X2_Y1+ZIOPC_RMSE_X1_Y2+ZIOPC_RMSE_X2_Y2)/6
generate RMSE_sd_ZIOPC=RMSE_mean_ZIOPC


collapse (mean) meaninfl RMSE_mean_OP RMSE_mean_ZIOP  RMSE_mean_ZIOPC (semean) RMSE_sd_OP RMSE_sd_ZIOP  RMSE_sd_ZIOPC, by(g0)

save "Global.RMSEs.ZIOPCDGP.dta", replace
